package com.base.util.demo.jniutils;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.base.util.demo.DemoBaseActivity;
import com.base.util.demo.R;
import com.base.util.javautils.app.BaseActivity;
import com.base.util.jniutils.JniPointerManager;
import com.base.util.jniutils.JniUtils;
import com.base.util.jniutils.log.JniLogConfig;
import com.base.util.jniutils.thread.JniThreadManager;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;

import java.util.concurrent.Executors;

@ContentView(R.layout.activity_jni_utils)
public class JniUtilsActivity extends DemoBaseActivity {

    public static void show(DemoBaseActivity act) {
        act.startActivity(new Intent(act, JniUtilsActivity.class));
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Event(value = R.id.btn_test_link_so)
    private void testLinkSo(View v) {
        JniUtils.testLink();
    }

    @Event(value = R.id.btn_test_log)
    private void testLog(View v) {
        JniLogConfig.unitTesting();
    }

    @Event(value = R.id.btn_test_base64)
    private void testBase64(View v) {
        Base64Activity.show(this);
    }

    @Event(value = R.id.btn_test_pointer)
    private void testPointer(View v) {
        JniPointerManager.unitTesting();
    }

    @Event(value = R.id.btn_test_thread)
    private void testThread(View v) {
        JniThreadManager.unitTesting();
    }

    @Event(value = R.id.btn_test_thread_pointer)
    private void testThreadPointer(View v) {
        JniThreadManager.pointerUnitTesting();
    }
}
